<template>
  <div class="header-con">
    <div>
      <img src="../assets/img/logo.png" alt="" class="img1" />
      <span class="el-icon-s-fold" @click="TOGGLE_SIDEBAR"></span>
    </div>
    <div class="header-text">
      <span>{{ username }}({{ type == 1 ? "超级管理员" : "普通管理员" }})</span>
      <img src="../assets/img/gita.gif" alt="" class="img2" />&nbsp;
      <span style="color: #ccc">|</span>
      <span
        style="color: #67acff; text-decoration: underline"
        @click="LogoutAction"
        >退出登陆</span
      >
      <img src="../assets/img/cn.png" alt="" class="img3" />
    </div>
  </div>
</template>

<script>
import { mapMutations, mapGetters, mapActions } from "vuex";
export default {
  name: "MyHeader",
  methods: {
    ...mapMutations(["TOGGLE_SIDEBAR"]),
    ...mapActions(["LogoutAction"]),
  },
  computed: {
    ...mapGetters(["username", "type"]),
  },
};
</script>

<style lang="scss" scoped>
.header-con {
  display: flex;
  justify-content: space-between;
  align-items: center;
  .header-text {
    display: flex;
    align-items: center;
    color: #605897;
    span {
      margin-left: 5px;
      margin-right: 5px;
    }
  }
  .img1 {
    height: 40px;
    margin-left: 10px;
  }
  .img2 {
    height: 40px;
  }
  .img3 {
    height: 50px;
  }
}
.el-icon-s-fold {
  display: inline-block;
  position: absolute;
  top: 15px;
  left: 150px;
}
</style>